"""


"""
class Solution:
    def maxArea(self, height):
        """
        :type height: List[int]
        :rtype: int
        """
        n = len(height)
        i, j = 0, n-1
        maxl = min(height[i], height[j])*j
        while i < j:
            cur = min(height[i], height[j])*(j-i)
            if cur > maxl:
                maxl = cur
            elif height[i] < height[j]:
                i += 1
            else:
                j -= 1
        return maxl

s = Solution()
print(s.maxArea([2,3,4,5,18,17,6]))